#ifndef RED_MSGPARSER_H
#define RED_MSGPARSER_H

#include "red_imsgent.h"
#include <libxml++/libxml++.h>

using namespace red::protocolo::mensajes::entrada;
using namespace Glib;
using namespace xmlpp;

namespace red {
namespace protocolo {

class MsgParser: public SaxParser {

public:

	MsgParser();
	~MsgParser();

	IMsgEnt *parsear(const ustring &p_usChunck);

protected:

	virtual void on_start_document();
	virtual void on_end_document();
	virtual void on_start_element(const ustring &name, const AttributeList &properties);
	virtual void on_end_element(const ustring &name);
	virtual void on_characters(const ustring &characters);
	virtual void on_comment(const ustring &text);
	virtual void on_warning(const ustring &text);
	virtual void on_error(const ustring &text);
	virtual void on_fatal_error(const ustring &text);

private:

	void cargarMsgEntChat(const AttributeList &attributes);
	void cargarMsgEntTextura(const AttributeList &attributes);

	IMsgEnt *m_pMsgEnt;
	bool m_bEndMsg;
};

}
}

#endif
